using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace BootyBay.Models.Mapping
{
    public class ApplicationInfoMap : EntityTypeConfiguration<ApplicationInfo>
    {
        public ApplicationInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ApplicationName)
                .IsRequired()
                .HasMaxLength(500);

            this.Property(t => t.MajorVersion)
                .IsRequired()
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("ApplicationInfo");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.ApplicationName).HasColumnName("ApplicationName");
            this.Property(t => t.MajorVersion).HasColumnName("MajorVersion");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.CreationDate).HasColumnName("CreationDate");
            this.Property(t => t.OperationDate).HasColumnName("OperationDate");
            this.Property(t => t.IsHidden).HasColumnName("IsHidden");
            this.Property(t => t.IsRecommended).HasColumnName("IsRecommended");
            this.Property(t => t.IsValid).HasColumnName("IsValid");
            this.Property(t => t.IsPublicApp).HasColumnName("IsPublicApp");
        }
    }
}
